home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / sticpsrc.lzh / SOURCE.ARC / SMTP.H < prev    next >
C/C++ Source or Header  |  1990-05-21  |  3KB  |  93 lines

  1. #undef    SMTPTRACE            /* enable tracing for smtp */
  2. #define MAXSESSIONS    10        /* most connections allowed */
  3. #define JOBNAME        13        /* max size of a job name with null */
  4. #define LINELEN        256
  5. #define MBOXLEN        8        /* max size of a mail box name */
  6.  
  7.  
  8. /* types of address used by smtp in an address list */
  9. #define BADADDR 0
  10. #define LOCAL    1
  11. #define DOMAIN    2
  12.  
  13. /* a list entry */
  14. struct list {
  15.     struct list *next;
  16.     char *val;
  17.     char type;
  18. };
  19.  
  20.  
  21. /* Per-session control block  used by smtp server */
  22. struct mail {
  23.     struct tcb *tcb;    /* TCP control block pointer */
  24.     char state;
  25. #define COMMAND_STATE    0
  26. #define DATA_STATE    1
  27.     char *system;        /* Name of remote system */
  28.     char *from;        /* sender address */
  29.     struct list *to;    /* Linked list of recipients */
  30.     char buf[LINELEN];    /* Input buffer */
  31.     int cnt;        /* Length of input buffer */
  32.     FILE *data;        /* Temporary input file pointer */
  33. };
  34.  
  35. /* used by smtpcli as a queue entry for a single message */
  36. struct smtp_job {
  37.     struct    smtp_job *next; /* pointer to next mail job for this system */
  38.     char    jobname[9];    /* the prefix of the job file name */
  39.     char    *system;        /* Name of forwarding system */
  40.     char    *from;        /* address of sender */
  41.     struct list *to;    /* Linked list of recipients */
  42. };
  43.  
  44. /* control structure used by an smtp client session */
  45. struct smtp_cb {
  46.     struct tcb *tcb;    /* tcp task control buffer */
  47.     int32    ipdest;        /* address of forwarding system */
  48.     char     state;        /* state machine placeholder */
  49. #define CLI_INIT_STATE    0
  50. #define CLI_OPEN_STATE    1
  51. #define CLI_HELO_STATE    2
  52. #define CLI_MAIL_STATE    3
  53. #define CLI_RCPT_STATE    4
  54. #define CLI_SEND_STATE    5
  55. #define CLI_UNLK_STATE    6
  56. #define CLI_QUIT_STATE    7
  57. #define CLI_IDLE_STATE    8
  58.     char    *wname;        /* name of workfile */
  59.     char    *tname;        /* name of data file */
  60.     char    buf[LINELEN];    /* Input buffer */
  61.     int    cnt;        /* Length of input buffer */
  62.     FILE    *tfile;
  63.     struct    smtp_job *jobq;
  64.     char    goodrcpt;    /* are any of the rcpt ok */
  65.     char    cts;        /* clear to send state indication */
  66.     int    rcpts;        /* number of unacked rcpt commands */
  67.     struct    list    *errlog;
  68. };
  69.  
  70. /* smpt server routing mode */
  71. #define QUEUE    1
  72.  
  73. #define NULLLIST    (struct list *)0
  74. #define NULLMAIL    (struct mail *)0
  75. #define NULLCB        (struct smtp_cb *)0
  76. #define NULLJOB        (struct smtp_job *)0
  77.  
  78.  
  79. extern char MAILSPOOL[];
  80. extern char MAILQDIR[];        /* Outgoing spool directory */
  81. extern char ROUTEQDIR[];    /* spool directory for a router program */
  82. extern char mailqueue[];    /* Prototype of work file */
  83. extern char hostname[];
  84. extern char ALIAS[];
  85.  
  86. extern int32 mailroute();
  87. extern int mlock(),rmlock(),queuejob();
  88. extern char *ptime();
  89. extern void del_list();
  90. extern long get_msgid();
  91. extern int16 smtpmode;
  92. extern struct list *addlist();
  93.